<template>
  <div class="ma-content-block lg:flex justify-between p-4">
    <!-- CRUD 组件 -->
    <ma-crud :options="options" :columns="columns" ref="crudRef">
    </ma-crud>
  </div>
</template>
<script setup>
import { ref, reactive } from 'vue'
import backendProjectWorker from '@/api/backend/backendProjectWorker'
import { Message } from '@arco-design/web-vue'
import tool from '@/utils/tool'
import * as common from '@/utils/common'

const crudRef = ref()




const options = reactive({
  id: 'backend_project_worker',
  rowSelection: {
    showCheckedAll: true
  },
  pk: 'id',
  operationColumn: false,
  operationColumnWidth: 160,
  formOption: {
    viewType: 'modal',
    width: 600
  },
  api: backendProjectWorker.getList
})

const columns = reactive([
  {
    title: "主键",
    dataIndex: "id",
    formType: "input",
    addDisplay: false,
    editDisplay: false,
    hide: true,
    commonRules: {
      required: true,
      message: "请输入主键"
    }
  },
  {
    title: "创建时间",
    dataIndex: "created_at",
    formType: "date",
    addDisplay: false,
    editDisplay: false,
    hide: true,
    showTime: true
  },
  {
    title: "更新时间",
    dataIndex: "updated_at",
    formType: "date",
    addDisplay: false,
    editDisplay: false,
    hide: true,
    showTime: true
  },
  {
    title: "删除时间",
    dataIndex: "deleted_at",
    formType: "date",
    addDisplay: false,
    editDisplay: false,
    hide: true,
    showTime: true
  },
  {
    title: "姓名",
    dataIndex: "name",
    formType: "input",
    search: true
  },
  {
    title: "姓名索引",
    dataIndex: "idx",
    formType: "input",
    addDisplay: false,
    editDisplay: false,
    hide: true
  },
  {
    title: "员工头像",
    dataIndex: "avatar",
    formType: "input",
    search: true
  },
  {
    title: "code",
    dataIndex: "code",
    formType: "input",
    search: true
  },
  {
    title: "联系电话",
    dataIndex: "phone",
    formType: "input",
    search: true
  },
  {
    title: "1男2女",
    dataIndex: "gender",
    formType: "input",
    search: true
  },
  {
    title: "单位id",
    dataIndex: "corp_unit_id",
    formType: "input",
    addDisplay: false,
    editDisplay: false,
    hide: true
  },
  {
    title: "岗位",
    dataIndex: "post",
    formType: "input",
    search: true
  },
  {
    title: "工种",
    dataIndex: "major",
    formType: "input",
    search: true
  },
  {
    title: "0否1是",
    dataIndex: "is_health",
    formType: "input",
    search: true
  },
  {
    title: "0否1是",
    dataIndex: "is_safety_edu",
    formType: "input",
    search: true
  },
  {
    title: "0否1是",
    dataIndex: "is_safety_inform",
    formType: "input",
    search: true
  },
  {
    title: "体检资料",
    dataIndex: "health",
    formType: "input",
    hide: true
  },
  {
    title: "安全教育资料",
    dataIndex: "safety_edu",
    formType: "input",
    hide: true
  },
  {
    title: "安全告知",
    dataIndex: "safety_inform",
    formType: "input",
    hide: true
  },
  {
    title: "项目id",
    dataIndex: "project_id",
    formType: "input",
    addDisplay: false,
    editDisplay: false
  },
  {
    title: "员工id",
    dataIndex: "staff_id",
    formType: "input",
    search: true,
    commonRules: {
      required: true,
      message: "请输入员工id"
    }
  },
  {
    title: "公司id",
    dataIndex: "corp_id",
    formType: "input",
    addDisplay: false,
    editDisplay: false,
    hide: true,
    commonRules: {
      required: true,
      message: "请输入公司id"
    }
  },
  {
    title: "用户id",
    dataIndex: "user_id",
    formType: "input",
    addDisplay: false,
    editDisplay: false,
    hide: true,
    commonRules: {
      required: true,
      message: "请输入用户id"
    }
  },
  {
    title: "1在岗2离岗3退岗",
    dataIndex: "status",
    formType: "input",
    search: true,
    commonRules: {
      required: true,
      message: "请输入1在岗2离岗3退岗"
    }
  },
  {
    title: "1项目人员2劳务工人3其他",
    dataIndex: "type",
    formType: "input",
    search: true,
    commonRules: {
      required: true,
      message: "请输入1项目人员2劳务工人3其他"
    }
  },
  {
    title: "进场0否1是",
    dataIndex: "enter",
    formType: "input",
    search: true
  },
  {
    title: "",
    dataIndex: "enter_at",
    formType: "date",
    search: true,
    showTime: false
  }
])
</script>
<script> export default { name: 'backend:projectWorker' } </script>